//
//  WeightsHistoryViewController.h
//  WeightMaster
//
//  Created by sungeo on 15/8/20.
//  Copyright (c) 2015年 buddysoft. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "WMHelper.h"

@class WeightsChartController, WMWeight;


@protocol WeightsChartDelegate <NSObject>

@optional

/**
 *  单击某个图片触发这个方法
 *
 *  @param controller 体重图表对象
 *  @param weight     体重对象
 */
- (void)weightsChartController:(WeightsChartController *)controller didTouchedImageAtWeightItem:(WMWeight *)weight;

/**
 *  单击体重图表对象
 *
 *  @param controller 体重图表对象
 *  @param weight     某个体重对象
 */
- (void)didTouchedWeightsChartController:(WeightsChartController *)controller withWeight:(WMWeight *)weight;

@end

@interface WeightsChartController : NSObject<UICollectionViewDelegate, UICollectionViewDataSource>

@property (nonatomic, strong) UIView * containerView;
@property (nonatomic, strong) UICollectionView * collectionView;

@property (nonatomic, strong) NSArray * items;
@property (nonatomic) WMWeightRange range;
@property (nonatomic) BOOL shouldShowDates;
@property (nonatomic) BOOL shouldShowSelectionState;

@property (nonatomic, weak) id<WeightsChartDelegate> delegate;

- (WMMood)moodForWeight:(WMWeight *)weight atIndexPath:(NSIndexPath *)indexPath;

- (NSInteger)indexOfItemForWeight:(WMWeight *)weight;

- (void)moveToRightestItem;

@end
